#include <iostream>
#include <algorithm>
#include <memory.h>
#include <queue>

#define MAXN 10005
using namespace std;

struct node {
	int u, v;
	char r;
	node(int x, char e, int y) {
		u = x;
		v = y;
		r = e;
	}
};

int S[MAXN], n, m, sum;
int vis[MAXN];
vector<int> G[MAXN];
vector<node> E;

int getf(int x) {
	if(x != S[x]) S[x] = getf(S[x]);
	return S[x];
}

bool merge(int x, int y) {
	int u = getf(x);
	int v = getf(y);
	if (u == v) return 0;

	S[u] = v;
    S[x] = v;
	return 1;
}

void TopSort() {
	queue<int> q;
	int flag = 0;
	for (int i = 0; i < n; ++i) {
		if(vis[i] == 0 && S[i] == i) q.push(i);
	}

	while(!q.empty()) {
		if(q.size() > 1) flag = 1;

		int t = q.front();
		q.pop();
		--sum;
		for(unsigned i = 0; i < G[t].size(); ++i) {
			--vis[G[t][i]];
			if(vis[G[t][i]] == 0) {
				q.push(G[t][i]);
			}
		}
	}

	if (sum > 0) cout << "CONFLICT" << endl;
	else if (flag) cout << "UNCERTAIN" << endl;
	else cout << "OK" << endl;
}

int main() {
	cin >> n >> m;
	sum = n;
    for(int i = 0; i <= n; ++i) S[i] = i;

	int x, y;
	char state;
	for (int i = 1; i <= m; ++i) {
        cin >> x >> state >> y;
		E.push_back(node(x, state, y));
		if (state == '=') {
			if (merge(x, y)) --sum;
		}
	}

	for(unsigned i = 0; i < E.size(); ++i) {
		if(E[i].r == '=') continue;

		int x = getf(E[i].u);
		int y = getf(E[i].v);

		if(E[i].r == '>') {
			++vis[y];
			G[x].push_back(y);
		} else {
			++vis[x];
			G[y].push_back(x);
		}
	}

	TopSort();
	return 0;
}
